/*
 * @Author       : 魏威 <1209562577@qq.com>
 * @Date         : 2022-04-01 16:18 周5
 * @Description  :
 */

import { useMemo } from "react";
import { useUrlParams } from "utils/url";

export const useProjectSearchParams = () => {
  const [param, setParam] = useUrlParams(["name", "personId"]);
  return [
    useMemo(() => {
      return {
        ...param,
        personId: Number(param.personId) || undefined,
      };
    }, [param]),
    setParam,
  ] as const;
};
